home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / macro28.lha / Macro / FinsGold / Modula / m2l.ged < prev    next >
Encoding:
Text File  |  1994-06-14  |  3.1 KB  |  133 lines

  1. /* m2l.ged $VER: 0.12 m2l.ged © 1994 Fin Schuppenhauer (12.06.94) */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  9. OPTIONS FAILAT 6                            /* ignore warnings         */
  10. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  11.  
  12.  
  13. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  14.  
  15.  
  16. 'QUERY CAT'
  17. german = (result = "deutsch")
  18.  
  19. /* Dateinamen ermitteln: */
  20. 'QUERY FILE VAR FILENAME'
  21. if (right(filename, 4) ~= '.def') & (right(filename, 4) ~= '.mod') then do
  22.    if german then
  23.       'REQUEST BODY="Dies ist kein Modula-2-Quelltext!"'
  24.    else
  25.       'REQUEST BODY="This is no modula-2 source!"'
  26.    'UNLOCK'
  27.    EXIT
  28. end
  29.  
  30. /* Gibt es überhaupt etwas zu übersetzen ? */
  31. 'QUERY ANYTEXT'
  32. if result = 'FALSE' then do
  33.    if german then
  34.       'REQUEST BODY="Ähmm, kein Quelltext hier.|Trotzdem linken?" BUTTON=Ja|Nein'
  35.    else
  36.       'REQUEST BODY="There''s no source here.|Still link ?" BUTTON=Yes|No'
  37.    if result= '0' then do
  38.       'UNLOCK'
  39.       EXIT
  40.    end
  41. end
  42.  
  43. /* Text verändert? Wenn ja, vorher sichern. */
  44. 'QUERY MODIFY'
  45. if result = 'TRUE' then do
  46.    if german then
  47.       'REQUEST BODY="Upps, der Text wurde aber verändert!"'
  48.    else
  49.       'REQUEST BODY="Urgh, there''s modified source here!"'
  50.    'UNLOCK'
  51.    EXIT
  52. end
  53.  
  54. /* Ist der Compiler aktiv ? */
  55. if ~show('P', 'M2L') then do
  56.    if german then
  57.       'REQUEST BODY="Der Linker läuft nicht!|Bitte starten."'
  58.    else
  59.       'REQUEST BODY="The linker is not running!|Please start."'
  60.    'UNLOCK'
  61.    EXIT
  62. end
  63.  
  64. /* Linke-Optionen ermitteln (sind (fast) alle per Default TRUE) */
  65. linkopt = "-"
  66. 'QUERY USER20'                 /* SmallCode */
  67. if result='FALSE' then
  68.    linkopt = linkopt || "c"
  69.  
  70. 'QUERY USER19'                 /* SmallData */
  71. if result='FALSE' then
  72.    linkopt = linkopt || "d"
  73.  
  74. 'QUERY USER16'                 /* DebugInfo */
  75. if result='FALSE' then
  76.    linkopt = linkopt || "x"
  77.  
  78. if linkopt = "-" then
  79.    linkopt = ""
  80.  
  81. /* Minimalarts? Resident? */
  82. 'QUERY USER18'                 /* MinimalArts */
  83. if result='TRUE' then
  84.    linkopt = linkopt || "+m"
  85.  
  86. 'QUERY USER17'                 /* Resident */
  87. if result='TRUE' then
  88.    linkopt = linkopt || "+r"
  89.  
  90. /* Piktogramme erzeugen? */
  91. 'QUERY USER14'
  92. if result = 'TRUE' then
  93.    icons = "+i"
  94. else
  95.    icons = "-i"
  96.  
  97.  
  98. filename = left(filename, length(filename)-4) || '.obj'
  99.  
  100. if german then
  101.    'REQUEST STATUS="Binde nun 'filename' .."'
  102. else
  103.    'REQUEST STATUS="Linking 'filename' ..."'
  104.  
  105. OPTIONS FAILAT 21
  106. ADDRESS 'M2L' "LINK " || linkopt || icons || " " || filename
  107.  
  108. 'REQUEST STATUS=""'
  109.  
  110. if rc ~= 0 then do
  111.    if german then
  112.       'REQUEST BODY="Es sind Fehler aufgetreten!"'
  113.    else
  114.       'REQUEST BODY="Some errors occured!"'
  115. end
  116. else do
  117.    if german then
  118.       'REQUEST BODY="Erfolgreich gelinkt."'
  119.    else
  120.       'REQUEST BODY="Linked successfully."'
  121. end
  122.  
  123. /* ---------------------------- END OF YOUR CODE --------------------- */
  124.  
  125. 'UNLOCK' /* VERY important: unlock GUI */
  126. EXIT
  127.  
  128. SYNTAX:
  129.  
  130. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  131. 'UNLOCK'
  132. EXIT
  133.